'''
当代码执行时，出现异常，将页面截屏保存，方便定位问题
'''

import time


from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.wait import WebDriverWait

driver = webdriver.Edge()
driver.get("http://www.baidu.com")
time.sleep(3)
# 获取一个时间字符串
timestr = time.strftime("%Y-%m-%d_%H-%M-%S",time.localtime())
driver.get_screenshot_as_file(f"d:\\baidu{timestr}.png")
time.sleep(3)
